import request from "@/utils/http";

// 添加商品到购物车接口
export function addItemToCartAPI(cartFormDTO) {
    return request({
        url: '/carts',
        method: 'post',
        data: cartFormDTO
    });
}

// 更新购物车数据接口
export function updateCartAPI(cart) {
    return request({
        url: '/carts',
        method: 'put',
        data: cart
    });
}

// 删除购物车中商品接口
export function deleteCartItemAPI(cart) {
    return request({
        url: `/carts`,
        method: 'delete',
        data: cart
    });
}

// 查询购物车列表接口
export function queryMyCartsAPI(business_id) {
    return request({
        url: '/carts',
        method: 'get',
        params: {
            'business_id': business_id
        }
    });
}

// 批量删除购物车中商品接口
// export function deleteCartItemByIdsAPI(ids) {
//     return request({
//         url: '/carts',
//         method: 'delete',
//         params: {
//             ids: ids
//         }
//     });
// }
